<?php

/**
 +-----------------------------------------------------
 * PublicModel
 +-----------------------------------------------------
 * @author	liuricheng 
 * @time	2014-03-13
 * @type	[add]
 * 
 */
import("ORG.Util.Function");


class TypeModel extends Model{
		
	// 获取类型列表
	public function getTypeList(){
		$sql	=	"
					SELECT t.*, COUNT(a.cat_id) AS attr_count FROM `ybr_goods_type` AS t 
					LEFT JOIN `ybr_attribute` AS a ON a.cat_id=t.cat_id 
					GROUP BY t.cat_id 
					";
		return $this->query($sql);
	}
	
}